<template>
    <div>
      <CountDownVue v-if="!isPay"/>
      <el-tabs type="border-card">
        <el-tab-pane label="微信支付">
          <img
            src="https://p1.meituan.net/pay/pc_wxqrpay.png"
            disabled=""
            alt="微信"
          />
          <div class="payment-submit-area clear-fix">
            <div class="amount">
              支付 ¥ <span class="amount-price">{{ order.amount }}</span>
            </div>
            <div class="payment-submit"><a class="btn">去付款</a></div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="支付宝支付"
          ><img
            src="https://p0.meituan.net/pay/alipaypcnew.png"
            disabled=""
            alt="支付宝"
          />
          <div class="payment-submit-area clear-fix">
            <div class="amount">
              支付 ¥ <span class="amount-price">{{ order.amount }}</span>
            </div>
            <div class="payment-submit" @click="aliPay"><a class="btn">去付款</a></div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </template>

<script>
import { mapState } from 'vuex'
import CountDownVue from '@/components/CountDown'
import { pay } from '@/api/order'
export default {
  name: 'TtmsPay',
  props: {
    isPay: {
      type: Boolean,
      default: true
    }
  },
  data () {
    return {}
  },
  components: {
    CountDownVue
  },

  mounted () {},

  methods: {
    aliPay () {
      pay(this.order.orderNo).then(res => {
        document.write(res)
      })
    }
  },
  computed: {
    ...mapState('order', ['order'])
  }
}
</script>

  <style lang="scss" scoped>
  .payment-submit-area {
    margin-top: 50px;
  }
  .clear-fix:after,
  .clear-fix:before {
    display: table;
    content: " ";
  }
  .clear-fix:after {
    clear: both;
  }
  .amount {
    text-align: right;
    font-size: 14px;
    color: #f60;
  }
  .amount-price {
    font-size: 30px;
    font-family: arial, sans-serif;
  }
  .payment-submit {
    float: right;
    margin-top: 14px;
  }
  .payment-submit .btn {
    font-size: 14px;
    padding: 10px 36px;
    border: none;
  }

  .btn {
    background-color: #f90;
    border-radius: 100px;
    background-image: linear-gradient(180deg, #ffa114, #f59300);
  }
  .btn,
  .btn-primary {
    color: #fff;
    border: none;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border-radius: 2px;
    letter-spacing: 2px;
    padding: 5px 12px 4px;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
  }
  a,
  button,
  input,
  select {
    padding: 0;
  }
  a {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
  }
  </style>
